package com.weayer.controller;

import com.weayer.dto.ResponseResult;
import com.weayer.remote.ServiceOrderClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: TestController
 * @author: Weayer
 * @description:
 * @date: 2023/11/12
 */
@RestController
public class TestController {
    @GetMapping("/test")
    public String test(){
        return "test api passenger";
    }
    @GetMapping("/authTest")
    public ResponseResult authTest(){
        return ResponseResult.success("auth Test");
    }
    @GetMapping("/noauthTest")
    public ResponseResult noauthTest(){
        return ResponseResult.success("noauth test");
    }

    @Autowired
    ServiceOrderClient serviceOrderClient;

    @GetMapping("/test-dispatch-real-time-order/{orderId}")
    public String dispatchRealTimeOrder(@PathVariable("orderId") long orderId){
        System.out.println("并发测试 orderId：" + orderId);
        serviceOrderClient.dispatchRealTimeOrder(orderId);
        return "test success";
    }


}
